package de.preisrobot.persistence.dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.springframework.stereotype.Repository;

import de.preisrobot.entity.Tb_Manufacturer;

@Repository(value="manufacturerDao")
public class ManufacturerDaoImpl implements ManufacturerDao{

	@PersistenceContext
	EntityManager em;
	
	@Override
	public List<Tb_Manufacturer> getAll(){
		
		Query createQuery = em.createQuery("select   m from Manufacturer  m order by  m.name");
		List<Tb_Manufacturer> resultList = createQuery.getResultList();
		return resultList;
	}
	
}
